import React, {FC, useEffect, useMemo} from "react";
import {Spin} from "antd";
import {autoLogin} from "../services/SecurityService.tsx";

interface AutoLoginProps {
}

const AutoLogin: FC<AutoLoginProps> = () => {
    useEffect(() => {
        autoLogin(window.location.search)
    }, []);
    const renderAutoLogin = useMemo(() => {
        return (
            <Spin tip="自动登录中...">
                <div style={{height: "100vh", lineHeight: "100vh", textAlign: "center"}}>
                </div>
            </Spin>
        )
    }, []);

    return (renderAutoLogin);
};

export default React.memo(AutoLogin);